<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<title>{{.title}}</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="{{.Prefix}}/static/style.css">
	<script src="{{.Prefix}}/static/jquery.min.js"></script>
	<script type="text/javascript" src="{{.Prefix}}/static/md5.js"></script>
	<script type="text/javascript" src="{{.Prefix}}/static/utils.js"></script>
	<script>
function clickme(){
	var s1 = getCookie("start")+getCookie("addr")+hex_md5(document.getElementById("pwd").value);
	var pwd0 = hex_md5( s1 );
	var name0 = document.getElementById("name").value;
	$.post("{{.Prefix}}/user/login",
		{pwd:pwd0,name:name0},
		function(res){
			document.write(res.toString());
		});
}
	</script>
</head>

<body>
<div style="width:800px;margin:auto;text-align:left;margin-top:30px;">
<a href="{{.Prefix}}/">返回</a>
<h3>{{.title}}</h3>
{{if eq .mode 0}}
<form method="POST" action="{{.Prefix}}/user/login" id="loginform">
<input type="text" name="name" id="name" /><br/>
<input type="password" name="pwd" id="pwd" /><br/>
</form>
<button onclick="clickme();">登录</button><br/><br/>
<a href="/user/reg">[注册]</a>
{{else}}<script>
function gopage(){
    location.href="{{.Prefix}}/chat/room";
}
//setTimeout(gopage,2000);
</script>
{{end}}
</div>
</body>
</html>

